package yns.springcloud.oakwood.guide.consumer;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestClient;
import org.springframework.web.client.RestClient.Builder;

@Component
public class RestClientConsumer {
	
	@Bean("loadBalanced")
	@LoadBalanced
	public Builder loadBalancedRestClientBuilder() {
		return RestClient.builder();
	}
	
	@Primary
	@Bean("single")
	public Builder singleRestClientBuilder() {
		return RestClient.builder();
	}
	
}
